package com.xhh.nphm.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xhh.nphm.system.domain.SmsNote;
import org.apache.ibatis.annotations.*;

@Mapper
public interface SmsNoteDao extends BaseMapper<SmsNote> {

    @Update("update tm_sms_note set sms_inform=#{smsInform},opt_time=#{optTime} where id = #{id,jdbcType=INTEGER}")
    boolean updateState(SmsNote smsNote);

    @Insert("insert into tm_sms_note(sms_inform,deptNo,deptName,opt_user,opt_userId,opt_type,opt_time)" +
            " values (#{smsInform},#{deptNo},#{deptName},#{optUser},#{optUserId},#{optType},#{optTime})")
    int insertValue(SmsNote smsNote);

    @Select("select id from tm_sms_note where deptNo = #{deptNo} and opt_userId = #{optUserId} and opt_type = #{optType}")
    Integer selectByDeptNo(SmsNote smsNote);

    @Select("select sms_inform from tm_sms_note where deptNo = #{deptNo} and opt_userId = #{optUserId} and opt_type = #{optType};")
    Integer selectSmsInform(@Param("deptNo") String deptId, @Param("optUserId")String userId, @Param("optType")Integer optType);
}
